same as below
authorRadek Doulik <rodo@helixcode.com>
Mon, 3 Apr 2000 08:59:43 +0000 (08:59 +0000)
committerRadek Doulik <rodo@src.gnome.org>
Mon, 3 Apr 2000 08:59:43 +0000 (08:59 +0000)
2000-03-29  Radek Doulik  <rodo@helixcode.com>

* gdk-pixbuf/gdk-pixbuf-animation.c
(gdk_pixbuf_animation_new_from_file): same as below

* gdk-pixbuf/io-gif.c (gif_get_lzw): added update of width and
height in GdkPixbufAnimation

2000-03-28  Radek Doulik  <rodo@helixcode.com>

* gdk-pixbuf/io-gif.c (gif_get_lzw): test also for
context->frame_done_func and context->anim_done_func to make
progressive animation loading work

* gdk-pixbuf/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done):
added priv->pixbuf = NULL as pixbuf is now in frame (and to make
gdk_pixbuf_loader_prepare happy)
(gdk_pixbuf_loader_frame_done): update animation bbox

* gdk-pixbuf/gdk-pixbuf.h: added bbox size (width, height) to
_GdkPixbufAnimation

2000-03-27  Radek Doulik  <rodo@helixcode.com>

* gdk-pixbuf/io-gif.c (gif_get_lzw): use frame_len and frame_width
instead of width and height

gdk-pixbuf/ChangeLog
gdk-pixbuf/gdk-pixbuf-animation.c
gdk-pixbuf/gdk-pixbuf-loader.c
gdk-pixbuf/gdk-pixbuf.h
gdk-pixbuf/io-gif.c
gtk/gdk-pixbuf-loader.c

index 5a5508e2b091f81ea2ee60483ea849aa7071fdc3..d6328958ee31fef456383669d3df492d3836463c 100644 (file)
        * gdk-pixbuf/gdk-pixbuf.c (gdk_pixbuf_get_has_alpha): Return
        gboolean instead of int.
 
+2000-03-29  Radek Doulik  <rodo@helixcode.com>
+
+       * gdk-pixbuf/gdk-pixbuf-animation.c
+       (gdk_pixbuf_animation_new_from_file): same as below
+
+       * gdk-pixbuf/io-gif.c (gif_get_lzw): added update of width and
+       height in GdkPixbufAnimation
+
+2000-03-28  Radek Doulik  <rodo@helixcode.com>
+
+       * gdk-pixbuf/io-gif.c (gif_get_lzw): test also for
+       context->frame_done_func and context->anim_done_func to make
+       progressive animation loading work
+
+       * gdk-pixbuf/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done):
+       added priv->pixbuf = NULL as pixbuf is now in frame (and to make
+       gdk_pixbuf_loader_prepare happy)
+       (gdk_pixbuf_loader_frame_done): update animation bbox
+
+       * gdk-pixbuf/gdk-pixbuf.h: added bbox size (width, height) to
+       _GdkPixbufAnimation
+
+2000-03-27  Radek Doulik  <rodo@helixcode.com>
+
+       * gdk-pixbuf/io-gif.c (gif_get_lzw): use frame_len and frame_width
+       instead of width and height
+
 2000-03-27  Owen Taylor  <otaylor@redhat.com>
 
        * gdk-pixbuf/pixops/pixops.c: Fix problem with 
index 0577a97c468df414c82e6d57ea611c34b812e4a2..3d853954d742a424605becd3d431bae2eba4aa11 100644 (file)
@@ -102,6 +102,8 @@ gdk_pixbuf_animation_new_from_file (const char *filename)
                animation->ref_count = 1;
                animation->n_frames = 1;
                animation->frames = g_list_prepend (NULL, frame);
+               animation->width = gdk_pixbuf_get_width (pixbuf);
+               animation->height = gdk_pixbuf_get_height (pixbuf);
        } else {
                fseek (f, 0, SEEK_SET);
                animation = (* image_module->load_animation) (f);
index 56637df75d31611f523548b0da864f697bd3c00b..777b767d1402c0e18c85d888fb1d638e7686510c 100644 (file)
@@ -263,10 +263,27 @@ gdk_pixbuf_loader_frame_done (GdkPixbufFrame *frame, gpointer loader)
 
        priv = GDK_PIXBUF_LOADER (loader)->private;
 
+       priv->pixbuf = NULL;
+
        if (priv->animation == NULL) {
                priv->animation = g_new0 (GdkPixbufAnimation, 1);
                priv->animation->n_frames = 0;
                priv->animation->ref_count = 1;
+               priv->animation->width  = gdk_pixbuf_get_width  (frame->pixbuf);
+               priv->animation->height = gdk_pixbuf_get_height (frame->pixbuf);
+       } else {
+               int w, h;
+
+               /* update bbox size */
+               w = gdk_pixbuf_get_width (frame->pixbuf);
+               h = gdk_pixbuf_get_height (frame->pixbuf);
+
+               if (w > priv->animation->width) {
+                       priv->animation->width = h;
+               }
+               if (h > priv->animation->height) {
+                       priv->animation->height = h;
+               }
        }
 
        priv->animation->frames = g_list_append (priv->animation->frames, frame);
index 01f2043bfc20318e4487b2a6480249304ede31a2..dc6197891dfe82f38812f49375f2e2f00e48c0f8 100644 (file)
@@ -80,6 +80,9 @@ struct _GdkPixbufAnimation {
 
        /* List of GdkPixbufFrame structures */
         GList *frames;
+
+       /* bounding box size */
+       int width, height;
 };
 
 \f
index c4397c497df634dee4de8cbf5af27385668ff57a..926871a3dc227541d50113b45500e88ba14e7706 100644 (file)
@@ -669,12 +669,12 @@ gif_get_lzw (GifContext *context)
                context->pixbuf = gdk_pixbuf_new (ART_PIX_RGB,
                                                  context->gif89.transparent != -1,
                                                  8,
-                                                 context->width,
-                                                 context->height);
+                                                 context->frame_len,
+                                                 context->frame_height);
 
                if (context->prepare_func)
                        (* context->prepare_func) (context->pixbuf, context->user_data);
-               if (context->animation || context->frame_done_func) {
+               if (context->animation || context->frame_done_func || context->anim_done_func) {
                        context->frame = g_new (GdkPixbufFrame, 1);
                        context->frame->x_offset = context->x_offset;
                        context->frame->y_offset = context->y_offset;;
@@ -696,8 +696,15 @@ gif_get_lzw (GifContext *context)
                        }
                        context->frame->pixbuf = context->pixbuf;
                        if (context->animation) {
+                               int w,h;
                                context->animation->n_frames ++;
                                context->animation->frames = g_list_append (context->animation->frames, context->frame);
+                               w = gdk_pixbuf_get_width (context->pixbuf);
+                               h = gdk_pixbuf_get_height (context->pixbuf);
+                               if (w > context->animation->width)
+                                       context->animation->width = w;
+                               if (h > context->animation->height)
+                                       context->animation->height = h;
                        }
                }
        }
@@ -782,7 +789,7 @@ gif_get_lzw (GifContext *context)
        }
  done:
        /* we got enough data. there may be more (ie, newer layers) but we can quit now */
-       if (context->animation) {
+       if (context->animation || context->frame_done_func || context->anim_done_func) {
                context->state = GIF_GET_NEXT_STEP;
        } else
                context->state = GIF_DONE;
@@ -821,7 +828,8 @@ gif_get_lzw (GifContext *context)
                }
        }
 
-       if (context->animation && context->state == GIF_GET_NEXT_STEP) {
+       if ((context->animation || context->frame_done_func || context->anim_done_func)
+           && context->state == GIF_GET_NEXT_STEP) {
                if (context->frame_done_func)
                        (* context->frame_done_func) (context->frame,
                                                      context->user_data);
@@ -1210,6 +1218,8 @@ gdk_pixbuf__gif_image_load_animation (FILE *file)
        context->animation->ref_count = 1;
        context->animation->n_frames = 0;
        context->animation->frames = NULL;
+       context->animation->width = 0;
+       context->animation->height = 0;
        context->file = file;
 
        gif_main_loop (context);
index 56637df75d31611f523548b0da864f697bd3c00b..777b767d1402c0e18c85d888fb1d638e7686510c 100644 (file)
@@ -263,10 +263,27 @@ gdk_pixbuf_loader_frame_done (GdkPixbufFrame *frame, gpointer loader)
 
        priv = GDK_PIXBUF_LOADER (loader)->private;
 
+       priv->pixbuf = NULL;
+
        if (priv->animation == NULL) {
                priv->animation = g_new0 (GdkPixbufAnimation, 1);
                priv->animation->n_frames = 0;
                priv->animation->ref_count = 1;
+               priv->animation->width  = gdk_pixbuf_get_width  (frame->pixbuf);
+               priv->animation->height = gdk_pixbuf_get_height (frame->pixbuf);
+       } else {
+               int w, h;
+
+               /* update bbox size */
+               w = gdk_pixbuf_get_width (frame->pixbuf);
+               h = gdk_pixbuf_get_height (frame->pixbuf);
+
+               if (w > priv->animation->width) {
+                       priv->animation->width = h;
+               }
+               if (h > priv->animation->height) {
+                       priv->animation->height = h;
+               }
        }
 
        priv->animation->frames = g_list_append (priv->animation->frames, frame);